﻿/* Autoduel Game
 * CS4911 Senior Design Project
 * Fall 2010 Semester
 * Ian Axelrod, Liz Ha, Andrew Muldowney, Edward Futch
 */

using System;
using System.Collections.Generic;
using System.Windows.Forms;

using AutoduelClient.GameClient.Player;

namespace AutoduelClient.GameUI
{
    public partial class InputBox : Form
    {
		#region Static Methods (1)
		public static String ShowPlayerList(String caption, List<Player> players)
        {
            InputBox inputBox = new InputBox(caption);

            foreach (Player player in players) {
                inputBox.comboBox.Items.Add(player.Name.Replace("Duelist: ", ""));
            }

            if (inputBox.ShowDialog() == DialogResult.OK)
            {
                return inputBox.comboBox.Text;
            }
            else
            {
                return null;
            }
        }
		#endregion

		#region Constructors (2)
		public InputBox()
        {
            InitializeComponent();
        }

		public InputBox(String caption)
        {
            InitializeComponent();
            this.Text = caption;
        }
		#endregion
    }
}
